require 'activeunreal'

class Pessoa < ActiveUnreal::Base
  connection UnrealDB::Connection.new('127.0.0.1')
  has 'name'
  has 'age'
  has 'job'
end

john = Pessoa.new('john') do |p|
  p.name = 'John Stuart'
  p.age = '30'
  p.job = 'programmer'
end

puts john.document.to_s

john.save

gets
puts "***************************"

other = Pessoa.get('john')

puts other.document.to_s
puts other.class.to_s
puts other.name
puts other.age
puts other.job

gets

puts "*******************************"
puts "QUERY JOHN=>AGE "

puts Pessoa.query_to_document("john=>age").to_s
puts "*******************************"

gets


Pessoa.close_connection